//
//  CMTestLOE.m
//  CocoaMesh
//
//  Created by George  Armah on 5/24/09.
//  Copyright 2009 Lafayette College. All rights reserved.
//

#import "CMTestLOE.h"


@implementation CMTestLOE

static CMLOE *sharedCMLOEManager = nil;

+(CMLOE*)sharedCMLOE
{
	@synchronized(self)
	{
		if (sharedCMLOEManager == nil)
		{
			sharedCMLOEManager = [[CMLOE alloc] init];
		}
	}
	return sharedCMLOEManager;
}

+ (id)objectfromPliist:(NSString *)plistFile withKey:(NSString *)key
{
	NSString *errorDesc = nil;
	NSPropertyListFormat format;
	NSString *plistPath = [[NSBundle mainBundle] pathForResource:plistFile ofType:@"plist"];
	NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath];
	
	NSDictionary *temp = (NSDictionary *)[NSPropertyListSerialization
										  propertyListFromData:plistXML
										  mutabilityOption:NSPropertyListMutableContainersAndLeaves
										  format:&format errorDescription:&errorDesc];
	
	if (!temp) {
		NSLog(errorDesc);
		[errorDesc release];
	}
	
	return [temp objectForKey:key];
}
@end
